package com.wj.console.constant;


/**
 * 通用枚举类
 * @author wj
 */
public class Enums {

	// 结果码
	public static enum RESULT_CODE {
		SUCCESS("1", "操作成功！"),
		SERVER_ERROR("101", "服务器异常！"), 
		PARAM_LACK("102", "请求缺少必要参数！"), 
		ACCESSTOKEN_LACK("103", "缺少accessToken！"), 
		ACCESSTOKEN_INVALID("104", "无效accessToken！"), 
		REFRESHTOKEN_LACK("105", "无效refreshToken！"), 
		AUTH_LIMIT("106", "接口访问权限受限！"), 
		OP_FREQUENTLY("107", "操作频繁！"), 
		
		UID_IS_NULL("201", "UID参数为空！"), 
		PARAM_ERROR("202", "参数错误！"), 
		USER_NOT_EXIST("203", "用户不存在！"), 
		PASSWORD_ERROR("204", "用户密码错误！"), 
		VERIFICATION_CODE_ERROR("205", "验证码错误！"), 
		OBJECT_NOT_EXIST("206", "查询对象不存在！"), 
		REPEAT_OBJECT("207", "重复对象！"), 
		SMS_ERROR("208", "短信接口异常！"),
		ACTIVATION_CODE_INVALID("209", "无效激活码！"),
		USER_DISABLE("210", "用户被禁用！"),
		ORG_DISABLE("211", "企业被禁用！");
		
		public String key;
		public String value;

		private RESULT_CODE(String key, String value) {
			this.key = key;
			this.value = value;
		}

		public static RESULT_CODE get(String key) {
			RESULT_CODE[] values = RESULT_CODE.values();
			for (RESULT_CODE object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		
		public String toString() {
			return key;
		}
		
	}
	
	// 成员用户类型
	public static enum MEMBER_SYS_TYPE {
		NORAML("normal", "普通用户"), 
		ENTIN("entIn", "企业在职用户"),
		ENTOUT("entOut", "企业离职用户");
		public String key;
		public String value;

		private MEMBER_SYS_TYPE(String key, String value) {
			this.key = key;
			this.value = value;
		}

		public static MEMBER_SYS_TYPE get(String key) {
			MEMBER_SYS_TYPE[] values = MEMBER_SYS_TYPE.values();
			for (MEMBER_SYS_TYPE object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		
		public String toString() {
			return key;
		}
	}
	
	// 成员用户状态
	public static enum MEMBER_STATUS {
		ENABLE("enable", "启用"), 
		DISABLE("disable", "禁用");
		public String key;
		public String value;

		private MEMBER_STATUS(String key, String value) {
			this.key = key;
			this.value = value;
		}

		public static MEMBER_STATUS get(String key) {
			MEMBER_STATUS[] values = MEMBER_STATUS.values();
			for (MEMBER_STATUS object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		
		public String toString() {
			return key;
		}
	}
	
	
}
